public class ThreadDemo8 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() ->{
            //这个线程持续的时间大概为1秒
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
        System.out.println("start之前"+ t.isAlive());
        t.start();
        System.out.println("start之后"+ t.isAlive());
        Thread.sleep(2000);
        //2秒后，该线程就与已经结束了
        System.out.println("start结束之后"+ t.isAlive());
    }
}
